/*! _widgets-lists.scss | Vuero | Css ninja 2020-2021 */

/* ==========================================================================
List Widgets Styles
========================================================================== */

/*
    1. List Widget Base
    2. List Widget V1
    3. List Widget V2
    4. List Widget V3
    5. Media Queries
*/

/* ==========================================================================
1. List Widget Base
========================================================================== */

.list-widget {
  @include vuero-l-card();

  padding: 30px;

  &:not(:last-child) {
    margin-bottom: 1.5rem;
  }

  &.is-straight {
    @include vuero-s-card();
  }

  &.tabbed-widget {
    .widget-head {
      .tabbed-controls {
        position: relative;
        display: flex;
        min-width: 140px;
        height: 32px;
        background: var(--widget-grey-dark-2);
        font-family: var(--font);
        border-radius: 8px;

        .tabbed-control {
          position: relative;
          width: 50%;
          display: flex;
          justify-content: center;
          align-items: center;
          font-size: 0.9rem;
          color: var(--light-text);
          z-index: 1;

          &.is-active {
            color: var(--smoke-white);

            &:first-child {
              ~ .tabbed-naver {
                margin-left: 0;
              }
            }

            &:nth-child(2) {
              ~ .tabbed-naver {
                margin-left: 50%;
              }
            }
          }
        }

        .tabbed-naver {
          position: absolute;
          top: 0;
          left: 0;
          width: 50%;
          height: 100%;
          border-radius: 8px;
          background: var(--primary);
          margin-left: 0;
          transition: all 0.3s;
          z-index: 0;
        }
      }
    }

    .inner-list-wrapper {
      display: none;
      animation: fadeInLeft 0.5s;

      &.is-active {
        display: block;
      }
    }
  }

  .widget-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 32px;
    margin-bottom: 10px;

    h3 {
      color: var(--dark-text);
      font-size: 1.1rem;
      font-weight: 500;
    }
  }

  .inner-list {
    padding: 10px 0;

    .inner-list-item {
      + .inner-list-item {
        margin-top: 24px;
      }
    }
  }
}

.is-dark {
  .list-widget {
    @include vuero-card--dark();

    &.tabbed-widget {
      .widget-head {
        .tabbed-controls {
          background: var(--dark-sidebar-light-3);

          .tabbed-naver {
            background: var(--primary);
          }
        }
      }
    }
  }
}

/* ==========================================================================
2. List Widget V1
========================================================================== */

.list-widget {
  &.list-widget-v1 {
    .go-icon {
      position: relative;
      display: flex;
      justify-content: center;
      align-items: center;
      height: 36px;
      width: 36px;
      border-radius: var(--radius-rounded);
      background: var(--widget-grey);
      color: var(--light-text);

      &::before {
        content: attr(data-content);
        position: absolute;
        left: -45px;
        font-family: var(--font);
        font-size: 0.95rem;
        font-weight: 500;
      }

      &.is-squared {
        border-radius: 10px;
      }

      &.is-up {
        &::before {
          color: var(--green);
        }
      }

      &.is-down {
        &::before {
          color: var(--red);
        }
      }

      svg {
        height: 16px;
        width: 16px;
        stroke-width: 3px;
      }
    }
  }
}

.is-dark {
  .list-widget {
    &.list-widget-v1 {
      .go-icon {
        background: var(--dark-sidebar-light-3);
        border: 1px solid var(--dark-sidebar-light-12);
      }
    }
  }
}

/* ==========================================================================
3. List Widget V2
========================================================================== */

.list-widget {
  &.list-widget-v2 {
    .image-icon {
      height: 40px;
      width: 40px;
    }
  }
}

/* ==========================================================================
4. List Widget V3
========================================================================== */

.list-widget {
  &.list-widget-v3 {
    .icon-timeline {
      .timeline-item {
        position: relative;
        display: flex;
        padding-bottom: 30px;

        &::after {
          content: '';
          position: absolute;
          top: 36px;
          left: 18px;
          width: 1px;
          height: calc(100% - 36px);
          border-left: 1px solid var(--fade-grey-dark-3);
        }

        .timeline-icon {
          position: relative;
          height: 36px;
          width: 36px;
          display: flex;
          justify-content: center;
          align-items: center;
          background: var(--white);
          border: 1px solid var(--fade-grey-dark-3);
          border-radius: var(--radius-rounded);
          color: var(--light-text);
          box-shadow: var(--light-box-shadow);

          &::after {
            content: '';
            position: absolute;
            top: 17px;
            left: 40px;
            width: 20px;
            height: 1px;
            border-top: 1px solid var(--fade-grey-dark-3);
          }

          &.is-squared {
            border-radius: 10px;

            img {
              border-radius: 10px;
            }
          }

          &.is-primary {
            background: var(--primary);
            border-color: var(--primary);
            box-shadow: var(--primary-box-shadow) svg {
              color: var(--smoke-white);
            }
          }

          &.is-info {
            background: var(--info);
            border-color: var(--info);
            box-shadow: var(--info-box-shadow);

            svg {
              color: var(--smoke-white);
            }
          }

          &.is-success {
            background: var(--success);
            border-color: var(--success);
            box-shadow: var(--success-box-shadow);

            svg {
              color: var(--smoke-white);
            }
          }

          &.is-orange {
            background: var(--orange);
            border-color: var(--orange);
            box-shadow: var(--orange-box-shadow);

            svg {
              color: var(--smoke-white);
            }
          }

          &.is-yellow {
            background: var(--yellow);
            border-color: var(--yellow);

            svg {
              color: var(--smoke-white);
            }
          }

          img {
            display: block;
            height: 28px;
            width: 28px;
            border-radius: var(--radius-rounded);
          }

          svg {
            height: 16px;
            width: 16px;
            stroke-width: 1.6px;
          }
        }

        .timeline-content {
          margin-left: 34px;
          line-height: 1.2;

          span {
            font-size: 0.85rem;
            color: var(--light-text);
          }

          p {
            font-family: var(--font-alt);
            font-size: 0.95rem;
            font-weight: 500;
            color: var(--dark-text);
          }
        }
      }
    }
  }
}

/* ==========================================================================
5. Media Queries
========================================================================== */

.is-dark {
  .list-widget {
    &.list-widget-v3 {
      .icon-timeline {
        .timeline-item {
          &::after {
            border-color: var(--dark-sidebar-light-12) !important;
          }

          .timeline-icon:not(.is-primary):not(.is-info):not(.is-success):not(.is-orange):not(.is-yellow) {
            background: var(--dark-sidebar-light-3) !important;
            border-color: var(--dark-sidebar-light-12) !important;
          }

          .timeline-icon {
            &::after {
              border-color: var(--dark-sidebar-light-12) !important;
            }

            &.is-primary {
              background: var(--primary);
              border-color: var(--primary);
              box-shadow: var(--primary-box-shadow) svg {
                color: var(--smoke-white);
              }
            }
          }

          .timeline-content {
            p {
              color: var(--dark-dark-text);
            }
          }
        }
      }
    }
  }
}
